package com.example.demo.dao;

import com.example.demo.entity.File;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Classname FileDao
 * @Description
 * @Date 2022/6/12 12:24 上午
 * @Author tangzb
 */
@Repository
public interface FileDao {

    @Select("select * from tab_file where user_id =#{userId}")
    List<File> listFile(Integer userId);

    @Insert("insert into tab_file values (null,#{file.name},#{file.img},#{file.user_id})")
    int add(@Param("file") File file);


}
